//
// Created by 雷欧 on 0031 2022/10/31.
//


#include "choose.h"
#include "stdio.h"
#include "math.h"
#include "string.h"

/**
 * 选择语法结构练习
 */
void practiceChoose() {

    /**
     * 比大小
     */
    /*int a,b;
    scanf("%d%d",&a,&b);
    if(a < b){
        printf("<");
    }else if (a > b){
        printf(">");
    }else{
        printf("=");
    }*/


    /**
     * 卡拉兹函数
     */
    /*int n,k;
    scanf("%d",&n);
    if(n % 2 == 0){
        k = n/2;
    }else{
        k = 3*n+1;
    }
    printf("%d",k);*/


    /**
     * 默契
     */
    /*int a,b;
    scanf("%d%d",&a,&b);
    if(a == b){
        printf("Tacit！");
    }else{
        printf("No Tacit!");
    }*/


    /**
     * 整除判断
     */
    /*int m,n;
    scanf("%d%d",&m,&n);
    if(m % n != 0){
        printf("NO");
    }else{
        printf("YES");
    }*/


    /**
     * CSimplemathproblem
     */
    /*long x,y;
    scanf("%ld%ld",&x,&y);
    if(y % x == 0){
        printf("%ld",x+y);
    }else{
        printf("%ld",y-x);
    }*/


    /**
     * 吃瓜群众
     */
    /*int weight;
    scanf("%d",&weight);
    if((weight - 2) % 2 == 0 && weight > 2){
        printf("YES, you can divide the watermelon into two even parts.");
    }else{
        printf("NO, you can't divide the watermelon into two even parts.");
    }*/

    /**
     * jyq跳格子
     */

    /*int n;
    scanf("%d",&n);
    if((n-1) % 2 == 0 || (n-1) % 4 == 0){
        printf("%d",n);
    }else{
        printf("-1");
    }*/

    /**
     * 牛妹数
     */
    /*int n;
    scanf("%d",&n);
    if(n > 50 && n%2 == 0){
        printf("yes");
    }else{
        printf("no");
    }*/

    /**
     * 判断闰年
     */
    /*int year;
    scanf("%d",&year);
    if((year%4 == 0 && year%100 != 0)
       || year%100 == 0 && year%400 == 0){
        printf("yes");
    }else{
        printf("no");
    }*/

    /**
     * 判断正负
     */
    /*int n,count,positive = 0,negative = 0;
    while(scanf("%d",&n) != EOF){
        if(n >= 0){
            positive += 1;
        }
        if(n < 0){
            negative += 1;
        }
        count++;
    }
    fflush(stdin);
    printf("positive:%d\n",positive);
    printf("negative:%d\n",negative); */

    /**
     * 小乐乐是否被叫家长
     */
    /*int a,b,c;
    scanf("%d%d%d",&a,&b,&c);
    if((a+b+c)/3 >= 60){
        printf("NO");
    }else{
        printf("YES");
    }*/

    /**
     * 最大最小值
     */
    /*int a,b,c,max,min;
    scanf("%d%d%d",&a,&b,&c);
    if(a > b){
        max = a;
        min = b;
    }else{
        max = b;
        min = a;
    }
    if(c > max){
        max = c;
    }
    if(c < min){
        min = c;
    }
    printf("The maximum number is : %d\n",max);
    printf("The minimum number is : %d",min);*/

    /**
     * 送分题
     */
    /*
   int a,b,c,max;
   scanf("%d%d%d",&a,&b,&c);
   if(a+b*c > a*(b+c)){
       max = a+b*c;
   }else{
       max = a*(b+c);
   }
   if(a*b*c > (a+b)*c){
       if(a*b*c > max){
           max = a*b*c;
       }
   }else{
       if((a+b)*c > max){
           max = (a+b)*c;
       }
   }
   if(a+b+c > max){
       max = a+b+c;
   }
   printf("%d",max);*/

    /**
     * 四季
     */
    /* char *month;
     scanf("%d",&month);
     int decade = month/10 %10;
     int unite = month%10;
     month = decade*10+unite;
     switch(month){
         case 3:case 4:case 5:
             printf("spring");
             break;
         case 6:case 7:case 8:
             printf("summer");
             break;
         case 9:case 10:case 11:
             printf("autumn");
             break;
         case 12:case 1:case 2:
             printf("winter");
             break;
     }*/

    /**
     * B是不是太迟了
     */
    //借鉴了一下思路，确实可以
    /*int year,month,day;
    scanf("%d/%d/%d",&year,&month,&day);
    if(month <= 10 & day+month < 10+29){
        printf("No. It's not too late.");
    }else{
        printf("QAQ");
    }*/

    /**
     * 前天是哪天
     */
    //绕晕自己
    /*int year,month,day;
    int d;
    scanf("%d-%d-%d",&year,&month,&day);
    int sig = day-2;
    int t = 1;
    if(sig <= 0){
        month -= 1;
        switch(month){
            case 1:case 3:case 5:case 7:case 8:case 10:case 12:
                d = 31;
                break;
            case 4:case 6:case 9:case 11:
                d = 30;
                break;
            case 2:
                if(year % 4 == 0 && year % 100 != 0 || year % 400 == 0){
                    d = 29;
                }else{
                    d = 28;
                }
                break;
        }
        //跨年
        if(month == 0 && day-2 <= 0){
            if(sig == 0){
                year -= 1;
                month = 12;
                d = 31;
            }
            if(sig < 0){
                year -= 1;
                month = 12;
                d = 30;
            }
            t = 2;
        }
        //跨月
        if(month > 0 && sig < 0 && t == 1){
            d -= 1;
        }
        //输出
        if(month < 10 && d < 10){
            printf("%d-%d-0%d",year,month,d);
        }
        else if(month < 10 && d >= 10){
            printf("%d-0%d-%d",year,month,d);
        }
        else if (d < 10 && month >= 10){
            printf("%d-%d-0%d",year,month,d);
        }
        else{
            printf("%d-%d-%d",year,month,d);
        }
    }
    else{
        if(month < 10 && sig < 10){
            printf("%d-0%d-0%d",year,month,sig);
        }
        else if(month < 10 && day-2 >= 10){
            printf("%d-0%d-%d",year,month,sig);
        }
        else if (day-2 < 10 && month >= 10){
            printf("%d-%d-0%d",year,month,sig);
        }
        else{
            printf("%d-%d-%d",year,month,sig);
        }
    }*/


    /**
     * L1-2单位换算
     */
    /* float f;
     scanf("%f",&f);
     float m = f*12*2.54*10;
     if(m == (int)m){
         printf("%.0f",m);
     }else{
         printf("%.1f",m);
     }*/

    /**
     * 排队取水
     */
    //一开始理解错了条件，费了半天时间
    /*int n,a,b;
    scanf("%d%d%d",&n,&a,&b);
    int num_a,num_b;
    num_a = n-a;
    num_b = b+1;
    if(num_a > num_b){
        printf("%d",num_b);
    }else if(num_a < num_b){
        printf("%d",num_a);
    }else{
        printf("%d",num_a);
    }*/

    /**
     * 可编程拖拉机比赛
     */
    /*double n;
    scanf("%lf",&n);
    double dem_gold = ceil(n*0.1) - floor(n*0.1);
    double dem_silver = ceil(n*0.2) - floor(n*0.2);
    double dem_copper = ceil(n*0.3) - floor(n*0.3);
//     printf("%.2lf\n",n*0.1);
//     printf("%.2lf\n",n*0.2);
//     printf("%.2lf\n",n*0.3);

    //向上取整与向下取整的差值 多出的金牌就是由银变金的数量
    printf("%.0lf ",dem_gold);
    //由银变金后银牌多出了x个，取整的差值再加上多出的x个
    printf("%.0lf ",dem_silver+dem_gold);
    //由上类推
    printf("%.0lf",dem_copper+dem_silver+dem_gold);*/

    /**
     * 不高兴的津津
     */
    /*int a,b;
    int i=1,j;
    int hour = 0;
    while(scanf("%d%d",&a,&b) != EOF){
        if(a+b > hour){
            hour = a+b;
            j = i;
        }
        i++;
    }
    printf("%d",j);*/

    /**
     * ISBN号码
     */
    /*int a,b,c,e;
    char d;
    int unite,decade,hundred,thousand,ten_thousand,result;
    scanf("%d-%d-%d-%c",&a,&b,&c,&d);
    ten_thousand = c/10000%10;
    thousand = c/1000%10;
    hundred = c/100%10;
    decade = c/10%10;
    unite = c%10;
    result = (a*1 + b/100%10*2 + b/10%10*3 + b%10*4 + ten_thousand*5 + thousand*6
              + hundred*7 + decade*8 + unite*9) % 11;
    //数字char转int
    e = d -'0';
    if(result == 10){
        if(d != 88){
            printf("%d-%d-%d-%s",a,b,c,"X");
        }else{
            printf("Right");
        }
    }
    else if (result == e){
        printf("Right");
    }
    else{
        printf("%d-%d-%d-%d",a,b,c,result);
    }*/


    /**
     * P5717 【深基3.习8】三角形分类
     */
/*
    int a, b, c, min, max, mid,temp;
    scanf("%d%d%d", &a, &b, &c);

    if(a < b){
        temp = a;
        a = b;
        b = temp;
    }
    if(b < c){
        temp = b;
        b = c;
        c = temp;
    }
    if(a < b){
        temp = a;
        a = b;
        b = temp;
    }
    max = a;mid = b;min = c;
//    printf("%d %d %d ", max, mid, min);
    if (mid + min <= max) {
        printf("Not triangle");
        return;
    }
    if (pow(min, 2) + pow(mid, 2) == pow(max, 2)) {
        printf("Right triangle\n");
    }
    if (pow(min, 2) + pow(mid, 2) > pow(max, 2)) {
        printf("Acute triangle\n");
    }

    if (pow(min, 2) + pow(mid, 2) < pow(max, 2)) {
        printf("Obtuse triangle\n");
    }
    if (max == mid || mid == min) {
        printf("Isosceles triangle\n");
        if (max == min && max == mid) {
            printf("Equilateral triangle\n");
        }
    }
*/


    /**
     * P1055 [NOIP2008 普及组] ISBN 号码
     */
    int a, b, c,d, sum, sumb=0, sumc=0, numb, numc, e = 4, f = 9;
    int m,n;
    scanf("%d-%d-%d-%s", &a, &b, &c, &d);
    m = b;
    n = c;
    while (m > 0) {
        numb = m % 10;
        sumb += numb * e--;
        m /= 10;
    }

    while (n > 0) {
        numc = n % 10;
        sumc += numc * f--;
        n /= 10;
    }
    sum = a * 1 + sumb + sumc;

    if(sum % 11 != 10){
        if(sum% 11 == d-'0'){
            printf("Right");
        } else{
            printf("%d-%d-%d-%d",a,b,c,sum%11);
        }
    } else{
        if(d == 88){
            printf("Right");
        } else{
            printf("%d-%d-%d-%c",a,b,c,'X');
        }
    }




}